home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Gamer (Italian) 30
/
PC Gamer IT CD 30 1-2.iso
/
MOTS
/
GAMEDATA
/
RESOURCE
/
JKMRES.GOO
/
cog_pow_backpack_m.cog
< prev
next >
Wrap
Text File
|
1998-02-25
|
2KB
|
81 lines
# Jedi Knight Cog Script
#
# POW_BACKPACK.COG
#
# POWERUP Script - Backpack
#
# [YB & CYW]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved
symbols
thing powerup local
thing player local
sound pickupsnd=BactaPu1.wav local
int autopickup=0 local
int autoselect_weapon=-1 local
message touched
message taken
end
# ========================================================================================
code
touched:
player = GetSourceRef();
powerup = GetSenderRef();
if (GetThingHealth(player) > 0)
TakeItem(powerup, player);
Return;
# ........................................................................................
taken:
player = GetSourceRef();
powerup = GetSenderRef();
jkPrintUNIString(player, 200);
// Do effects.
PlaySoundLocal(pickupsnd, 1, 0, 0);
AddDynamicTint(player, 0.0, 0.0, 0.2);
// Pickup the backpack
PickupBackpack(player, powerup);
// New ammo is already assigned, so this is like a autopickup/autoreload mix,
// it will select the best weapon overall with all the stuff in the backpack
// taken into account.
autopickup = GetAutoPickup();
autoselect_weapon = AutoSelectWeapon(player, 0);
if(autopickup & 1)
{
if( !((autopickup & 2) && ((autoselect_weapon == 4) || (autoselect_weapon == 8) || (autoselect_weapon == 9)) ))
{
if(!((autopickup & 4) && (GetWeaponPriority(player, GetWeaponBin(GetCurWeapon(player)), 0) >= GetWeaponPriority(player, autoselect_weapon, 0) )))
{
if(!((autopickup & 8) && (GetWeaponBin(GetCurWeapon(player)) == jkGetMultiParam(1))))
{
SelectWeapon(player, autoselect_weapon);
Return;
}
}
}
}
Return;
end